package com.jsp.service.impl;

import com.jsp.dao.EmployeeDao;
import com.jsp.dao.impl.EmployeeDaoImpl;
import com.jsp.entity.Employee;
import com.jsp.service.EmployeeService;

import java.util.List;

/**
 * @author wzm
 * @create 2023-03-10 10:35
 */
public class EmployeeServiceImpl implements EmployeeService {

    private EmployeeDao employeeDao = new EmployeeDaoImpl();


    @Override
    public boolean saveEmp(Employee employee) {
        return employeeDao.insertEmp(employee) > 0;
    }

    @Override
    public boolean rempveEmp(Employee employee) {
        return employeeDao.deleteEmp(employee) > 0;
    }

    @Override
    public boolean editEmp(Employee employee) {
        return employeeDao.updateEmp(employee) > 0;
    }

    @Override
    public Employee getEmpById(Employee employee) {
        return employeeDao.selectById(employee);
    }

    @Override
    public List<Employee> getEmpAll() {
        return employeeDao.selectByList();
    }
}
